package com.ruoyi.sts.service.impl;

import java.util.Collections;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sts.mapper.StsDataSynMapper;
import com.ruoyi.sts.domain.StsDataSyn;
import com.ruoyi.sts.service.IStsDataSynService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;

/**
 * 客流信息同步Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-26
 */
@Service
public class StsDataSynServiceImpl implements IStsDataSynService 
{
    @Autowired
    private StsDataSynMapper stsDataSynMapper;

    /**
     * 查询客流信息同步
     * 
     * @param id 客流信息同步主键
     * @return 客流信息同步
     */
    @Override
    public StsDataSyn selectStsDataSynById(Long id)
    {
        return stsDataSynMapper.selectStsDataSynById(id);
    }

    /**
     * 查询客流信息同步列表
     * 
     * @param stsDataSyn 客流信息同步
     * @return 客流信息同步
     */
    @Override
    public List<StsDataSyn> selectStsDataSynList(StsDataSyn stsDataSyn)
    {
        return stsDataSynMapper.selectStsDataSynList(stsDataSyn);
    }

    /**
     * 新增客流信息同步
     * 
     * @param stsDataSyn 客流信息同步
     * @return 结果
     */
    @Override
    @Transactional
    public int insertStsDataSyn(StsDataSyn stsDataSyn)
    {
        stsDataSyn.setCreateTime(DateUtils.getNowDate());
        return stsDataSynMapper.insertStsDataSyn(stsDataSyn);
    }

    /**
     * 修改客流信息同步
     * 
     * @param stsDataSyn 客流信息同步
     * @return 结果
     */
    @Override
    @Transactional
    public int updateStsDataSyn(StsDataSyn stsDataSyn)
    {
        stsDataSyn.setUpdateTime(DateUtils.getNowDate());
        return stsDataSynMapper.updateStsDataSyn(stsDataSyn);
    }

    /**
     * 批量删除客流信息同步
     * 
     * @param ids 需要删除的客流信息同步主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteStsDataSynByIds(String ids)
    {
        return stsDataSynMapper.deleteStsDataSynByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客流信息同步信息
     * 
     * @param id 客流信息同步主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteStsDataSynById(Long id)
    {
        return stsDataSynMapper.deleteStsDataSynById(id);
    }

    @Override
    public List<StsDataSyn> selectStsDataNoSynList() {
        return stsDataSynMapper.selectStsDataNoSynList();
    }
}
